<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改资产数据')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-asset-edit" th:object="${asset}">
			<input id="id" name="id" th:field="*{id}"  type="hidden">
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">资产编号：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="assetNo" id="assetNo" th:field="*{assetNo}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">资产名称：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="assetName" id="assetName" th:field="*{assetName}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">资产类型：</label>
				<div class="col-sm-8">
					<div class="radio-box" th:each="dict : ${@dict.getType('oa_asset_type')}">
						<input type="radio" th:id="${dict.dictCode}" name="assetType" th:value="${dict.dictValue}" th:field="*{assetType}">
						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">数量：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="num" id="num" th:field="*{num}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">单位：</label>
				<div class="col-sm-8">
					<div class="radio-box" th:each="dict : ${@dict.getType('oa_asset_num_unit')}">
						<input type="radio" th:id="${dict.dictCode}" name="numUnit" th:value="${dict.dictValue}" th:field="*{numUnit}">
						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">单价：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="price" id="price" th:field="*{price}" required>
				</div>
			</div>
		</form>
	</div>
	<th:block th:include="include :: footer" />
	<script type="text/javascript">
		var prefix = ctx + "oa/asset";
	
		$("#form-asset-edit").validate({
			rules:{
				dictSort:{
					digits:true
				},
			},
			focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	        	$.operate.save(prefix + "/edit", $('#form-asset-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
